From: Andreas Beckmann Date: Wed, 29 Jul 2020 10:52:56 +0000 (+0100) Subject: limit safety margin for local memory X-Git-Tag: archive/raspbian/1.6-3+rpi1~1^2~10 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=1ede16c915f21526febfa4717d47598168507053;p=pocl.git limit safety margin for local memory Bug: https://github.com/pocl/pocl/issues/810 avoids out-of-memory on 32-bit platforms with large caches and corecount Gbp-Pq: Name issue-810.patch --- diff --git a/lib/CL/devices/pthread/pthread_scheduler.c b/lib/CL/devices/pthread/pthread_scheduler.c index 1e7ae40..16fc64c 100644 --- a/lib/CL/devices/pthread/pthread_scheduler.c +++ b/lib/CL/devices/pthread/pthread_scheduler.c @@ -104,7 +104,7 @@ pthread_scheduler_init (cl_device_id device) /* safety margin - aligning pointers later (in kernel arg setup) * may require more local memory than actual local mem size. * TODO fix this */ - scheduler.local_mem_size = device->local_mem_size << 4; + scheduler.local_mem_size = device->local_mem_size + device->max_parameter_size * MAX_EXTENDED_ALIGNMENT; for (i = 0; i < num_worker_threads; ++i) {